package test.test1202;

public class test10 {
    public static void main(String[] args){
        int[] arr=new int[]{1,2,7,4,5,6};
        int max=max(arr);
        System.out.println(max);
    }
    public static int max(int[] arr){
        int max=arr[0];
        for (int i = 1; i < arr.length; i++) {
            max=max>arr[i]?max:arr[i];
        }
        return max;
    }
}
